package com.xiaojf.xlog.appender.file;

import cn.hutool.json.JSONUtil;
import com.xiaojf.xlog.appender.AccessLogAppender;
import com.xiaojf.xlog.model.XlogAccessLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 文件形式记录访问日志
 *
 * @author Ade.Xiao 2021/3/11 14:35
 */
public class AccessLogFileAppender implements AccessLogAppender {
    private final Logger logger = LoggerFactory.getLogger(AccessLogFileAppender.class);

    @Override
    public void record(XlogAccessLog log) {
        logger.info(JSONUtil.toJsonStr(log));
    }
}
